import Vue from 'vue'
import Router from 'vue-router'
import Home from './views/Home'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'home',
      component: Home,
    },
    {
      path: '/shop/detail/:id',
      name: '店铺详情',
      component: () => import('./views/Shop/detail')
    },
    {
      path: '/shop/info/:id',
      name: '店铺信息',
      component: () => import('./views/Shop/info')
    },
    {
      path: '/my/address',
      name: '收货地址',
      component: () => import('./views/My/address')
    },
    {
      path: '/my/address/new',
      name: '新增收货地址',
      component: () => import('./views/My/address-new')
    },
    {
      path: '/my/red',
      name: '红包管理',
      component: () => import('./views/My/red')
    },
    {
      path: '/order',
      name: '订单',
      component: () => import('./views/Order')
    },
    {
      path: '/order/detail/:no',
      name: '订单',
      component: () => import('./views/Order/detail')
    },
    {
      path: '/order/confirm/:id',
      name: '订单确认',
      component: () => import('./views/Order/confirm')
    },
    {
      path: '/my',
      name: '我的',
      component: () => import('./views/My')
    },
    {
      path: '/my/member/:code',
      name: '会员页面',
      component: () => import('./views/My/member')
    },
    {
      path: '/map/location',
      name: '地图定位',
      // route level code-splitting
      // this generates a separate chunk (about.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import('./views/MapLocation')
    }
  ]
})
